<template>
  <div class="proInfo">
    <div class="plane_bg">
      <p class="plane-p">摄像头名称</p>
    </div>
    <div class="d-flex proForm">
      <div
        class="d-flex flex-box"
        v-for="(item, index) in objData"
        :key="index"
      >
        <div class="form-labels">{{ item }}</div>
        <div class="form-content">
          {{ formData[Object.keys(formData)[index]] }}
        </div>
      </div>
    </div>
    <div class="d-flex">
      <div
        class="d-flex flex-box w-100"
        v-for="(item, index) in photolist"
        :key="index"
      >
        <div class="w-100">
          <p :style="{color:item.color,fontWeight:500}">
            <span :style="{ backgroundColor: item.color }" class="square"></span
            >{{ item.name + "照片" }}
          </p>
          <div :class="{noBg:!item.url}">
            <p v-if="item.url" class="plane-p">{{ item.time }}</p>
          </div>
        </div>
      </div>
    </div>
    <div style="text-align: right;margin-top:40px">
         <el-button size="large"  class="cancel" @click="resetForm">取消</el-button>

        <el-button size="large" class="save" type="primary" @click="confirm">启动预案</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import Mitt from "@/utils/mitt";
import type { ComponentSize, FormInstance, FormRules } from "element-plus";
const formData = reactive({
  name: "xx名称",
  level: "xx等级",
  address: "地址",
  company: "建立单位",
  creatDate: "2023-09-23",
  createTime: "2023-09-30",
  sjzt: "xx状态",
  createUser: "建立人",
  sjlb: "xx类型",
  sjdw: "xx单位",
  sbsj: "2023-09-30",
  sbr: "xx",
  desc: "",
  qyfzr: "",
  fzrlxfs: "187****0199",
});
const objData = [
  "事件名称:",
  "事件等级:",
  "事件地址:",
  "建立单位:",
  "事件时间:",
  "事件状态:",
  "建立人:",
  "事件类别:",
  "事件单位:",
  "上报时间:",
  "上报人:",
  "描述:",
  "区域负责人:",
  "负责人联系方式:",
];

const photolist = [
  { name: "处理前", url: "", color: "#FCE2B9", time: "2020-01-02" },
  { name: "处理中", url: "", color: "#5CE1FF" },
  { name: "处理后", url: "", color: "#B8EB8F" },
];
const formRef = ref<FormInstance>();

function resetForm() {
  formRef.value.resetFields();
}

function confirm() {
  Mitt.emit("close-dialog");
}
</script>

<style lang="less" scoped>
.proInfo{
    color: white;
}
.proForm {
  flex-flow: row nowrap;
  flex-wrap: wrap;
  align-items: stretch;
  padding-bottom: 20px;
  border-bottom: 1px dashed #667a8e;
  margin: 10px;
}
.form-labels {
  color: #667a8e;
  min-width: 120px;
}
.form-content {
  color: white;
}
.d-flex {
  display: flex;
}
.flex-box {
  flex: 0 0 31%;
  margin: 0 10px;
  display: flex;
  align-items: center;
  font-size: 20px;
  line-height: 40px;
}
.plane_bg {
  background: url("./image/plane.jpg") no-repeat center center !important;
  background-size: 100% 100% !important;
  height: 350px;
  .plane-p {
    background-color: rgba(0, 0, 0, 0.52);
    line-height: 40px;
    padding-left: 20px;
    color: white;
    font-size: 20px;
    height: 40px;
    position: absolute;
    width: 100%;
    bottom: -10px;
  }
}
.square {
  width: 14px;
  height: 14px;
  background-color: #3498db;
  /* 旋转45度 */
  transform: rotate(45deg);
  /* 为了在旋转后仍然居中显示，可能需要一些额外的定位或边距调整 */
  position: relative;
  // top: 7px; /* 或其他适当的值，取决于你的布局和需要 */
  left: 7px; /* 或其他适当的值，取决于你的布局和需要 */
  display: inline-block;
  margin-right: 14px;
}
.noBg{
    width: 100%;
    height: 216px;
    background-color: #253948;
}
.cancel{
    color: #1BFBFA;
    background: rgba(27,251,250,0.19);
    border: 1px solid #1BFBFA;
}
.save{
    color: #091C25;
    background: #1BFBFA;
}
</style>
